/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.put.dcs.core.workflow.serializer;


import java.io.InputStream;
import java.util.logging.Logger;
import pl.put.dcs.core.utils.serializer.SerializeManager;
import pl.put.model.flowModel.FlowModel;
/**
 * Serializer, ktory ma ulatwic pozniejsze przejscie na xpdl. Wszystkie klasy z dcs-core sa dystrybuowane, tj. wystepuja one, takze w serwerze aplikacji.
 * Ulatwia to publikacje projektu na serwer.
 *
 * @author LukaszR
 */
public class WorkflowSerializer
{
    public static Logger log = Logger.getLogger( WorkflowSerializer.class.getName() );

    public String serializeFlow( FlowModel flowModel )
    {
        SerializeManager sm = new SerializeManager();
        return sm.serializeToString( flowModel );
    }

    public FlowModel unserializeFlow( InputStream is )
    {
        SerializeManager sm = new SerializeManager();
        sm.init();
        return ( FlowModel )sm.unSerializeFromFile( is );
    }

}
